//
//  PackageDetailInfoCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/8/2.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "PackageDetailInfoCell.h"

@implementation PackageDetailInfoCell

- (void)layoutSubviews {
    

}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.packagePriceLab.userInteractionEnabled = YES;
      [self.packagePriceLab addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
          if (self.PackageDetailInfoBlock) {
              self.PackageDetailInfoBlock();
          }
      }];
}

- (void)fillCellWithModel:(CommonPackageModel *)model {
    self.model = model;
    
    self.packageNameLab.text = model.goodsName;
    
//    if ([TTUserModel sharedObject].token.length > 0) {

        self.packagePriceLab.text =[NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.goodsActivePrice]];
        
        if (model.goodsTotal > 0) {
            NSDictionary*attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
            NSMutableAttributedString*attribtStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:self.model.goodsTotal]] attributes:attribtDic];// 赋值strikeLabel.attributedText=
            self.packageOriginalPriceLab.attributedText = attribtStr;
        } else {
            self.packageOriginalPriceLab.hidden = YES;
        }
        
//    } else {
//        self.packagePriceLab.text = @"登录后查看补贴价";
//        self.packageOriginalPriceLab.hidden = YES;
//    }
    
    self.packageOriginalPriceLab.hidden = YES;

}

+ (CGFloat)calculateHeight {
    return 110;
}

@end
